import axios from 'axios';

class Service {
    static listProcess(baseQuery, callback) {
        return axios.post("/manage-api/list-process", baseQuery).then((data) => {
            callback ? callback(data) : null;
        })
    }

    static addProcess(process, callback) {
        return axios.post("/manage-api/process", process).then((data) => {
            callback ? callback(data) : null;
        })
    }

    static removeProcess(id, callback) {
        return axios.delete("/manage-api/process/" + id).then((data) => {
            callback ? callback(data) : null;
        })
    }

    static updateProcess(process, callback) {
        return axios.put("/manage-api/process", process).then((data) => {
            callback ? callback(data) : null;
        })
    }

    static getProcess(id, callback) {
        return axios.get("/manage-api/process/" + id).then((data) => {
            callback ? callback(data) : null;
        })
    }
}

export default Service;